<template>
	<div class="student">
		<h2>我是Student组件</h2>
		<h2>学生名字：{{name}}</h2>
		<button @click="sendNameToSchool">点我把学生名给School</button>
	</div>
</template>

<script>
	export default {
		name:'Student',
		data() {
			return {
				name:'张三'
			}
		},
		methods: {
			sendNameToSchool(){
				this.$bus.$emit('haha',this.name)
			}
		},
	}
</script>

<style>
	.student{
		background-color: skyblue;
		padding: 20px;
	}
</style>